|
Ant Farm - Robert Glen Martin School for the Talented and Gifted Dallas I.S.D. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectinfo.gridworld.actor.Actor
Food
public abstract class Food
Food is the top level abstract class for different
types of food. A food object waits for a
WorkerAnt to get food from it. It does not act.
| Field Summary | |
|---|---|
private int |
BITE_SIZE
The size of a bite |
private int |
foodEaten
The total amount of food eaten |
| Constructor Summary | |
|---|---|
Food(int bite)
Constructs a Food actor. |
|
| Method Summary | |
|---|---|
void |
act()
"Do nothing" act method. |
void |
process(WorkerAnt ant)
Gives food and current location to ant. |
java.lang.String |
toString()
Creates a string that describes this actor. |
| Methods inherited from class info.gridworld.actor.Actor |
|---|
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, setDirection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final int BITE_SIZE
private int foodEaten
| Constructor Detail |
|---|
public Food(int bite)
Food actor. The image is
displayed for this actor without tinting.
| Method Detail |
|---|
public void process(WorkerAnt ant)
ant.
process in interface Processableant - the calling WorkerAntpublic void act()
Cake, Cookie, and QueenAnt classes which do not act.
act in class info.gridworld.actor.Actorpublic java.lang.String toString()
toString in class info.gridworld.actor.ActorActor information
plus the amount of food eaten from this Cake
|
© 2007 Robert Glen Martin. All rights reserved. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||